<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>
<%@ page 
	import="java.util.*"
	import="net.sf.json.*"
	import="com.markan.facebook.*"
	import="com.markan.facebook.utl.*" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<%
	//액세스 토큰
	String accessToken = (String) session.getAttribute("access_token");	

	//FB 객체 생성
	Facebook facebook = new Facebook(accessToken);
%>

<ul>
<%	
	//그룹 정보를 가져온다.
	JSONObject jsonObj = facebook.getMyGroupInfo();
	JSONArray groupsJSONArr = MknJSONUtil.getObject2JSONArray( jsonObj.get("data"));
	for(int i=0, groupSize = groupsJSONArr.size(); i<groupSize; i++ ) {
		JSONObject groupJsonObj = (JSONObject) groupsJSONArr.get(i);
		
		int version = MknJSONUtil.getObject2Integer(groupJsonObj.get("version"));
		String name = (String) groupJsonObj.get("name");
		String id = (String) groupJsonObj.get("id");
		boolean administrator = MknJSONUtil.getObject2Booelan(groupJsonObj.get("administrator"));
		int bookmarkOrder = MknJSONUtil.getObject2Integer(groupJsonObj.get("bookmark_order"));
%>
<li><%=name%></li>
<%	
	}
%>
</ul>
<!-- 
//그룹 상세 정보
{
   "id": "373500192662219",
   "version": 1,
   "owner": {
      "name": "Jeong Seok Oh",
      "id": "100001115586163"
   },
   "name": "\uc218\uc790\uc6d0\uacf5\uc0ac",
   "privacy": "CLOSED",
   "icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yI/r/0pjqWL1NfkE.png",
   "updated_time": "2012-04-19T05:27:22+0000",
   "email": "373500192662219\u0040groups.facebook.com"
}
 -->
</body>
</html>